<template>
  <div class="custom-form">
    <el-row :gutter="15">
      <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="100px"
        :key="showFormKey">
        <!-- 技术方案协议等文件审批单 -->
        <el-col :span="24">
          <el-form-item label-width="0" prop="field100bb34">
            <h2 align='center' style="color:undefined;font-size: nullpx;text-align: center">技术方案协议等文件审批单</h2>
          </el-form-item>
        </el-col>
        <!-- 当前用户 -->
        <el-col :span="24" v-if="hasFormPermission('current_user_id')" v-show="showFlag">
          <el-form-item :label="$t('当前用户')" prop="current_user_id">
            <avue-information-body :operationVal="operationVal" infoType='user'
              :whetherToRebindSecondaryEditing='false' v-model="formData['current_user_id']"
              placeholder="当前用户" :disabled="hasDisabledPermission('current_user_id',true)"
              :readonly="!hasEditPermission('current_user_id',true)" :style="{width: '100%'}">
            </avue-information-body>
          </el-form-item>
        </el-col>
        <!-- 职级名称 -->
        <el-col :span="24" v-if="hasFormPermission('job')" v-show="showFlag">
          <el-form-item :label="$t('职级名称')" prop="job">
            <el-input v-model="formData['job']" placeholder="请输入职级名称"
              :disabled="hasDisabledPermission('job',false)"
              :readonly="!hasEditPermission('job',false)" clearable :style="{width: '100%'}"></el-input>
          </el-form-item>
        </el-col>
        <!-- 角色ID -->
        <el-col :span="24" v-if="hasFormPermission('role_id')" v-show="showFlag">
          <el-form-item :label="$t('角色ID')" prop="role_id">
            <el-input v-model="formData['role_id']" placeholder="请输入角色ID"
              :disabled="hasDisabledPermission('role_id',false)"
              :readonly="!hasEditPermission('role_id',false)" clearable :style="{width: '100%'}">
            </el-input>
          </el-form-item>
        </el-col>
        <!-- 角色名称 -->
        <el-col :span="24" v-if="hasFormPermission('role_name')" v-show="showFlag">
          <el-form-item :label="$t('角色名称')" prop="role_name">
            <el-input v-model="formData['role_name']" placeholder="请输入角色名称"
              :disabled="hasDisabledPermission('role_name',false)"
              :readonly="!hasEditPermission('role_name',false)" clearable :style="{width: '100%'}">
            </el-input>
          </el-form-item>
        </el-col>
        <!-- 地区 -->
        <el-col :span="24" v-if="hasFormPermission('area')" v-show="showFlag">
          <el-form-item :label="$t('地区')" prop="area">
            <el-input v-model="formData['area']" placeholder="请输入地区"
              :disabled="hasDisabledPermission('area',false)"
              :readonly="!hasEditPermission('area',false)" clearable :style="{width: '100%'}"></el-input>
          </el-form-item>
        </el-col>
        <!-- 申请人ID -->
        <el-col :span="24" v-if="hasFormPermission('user_id')" v-show="showFlag">
          <el-form-item :label="$t('申请人ID')" prop="user_id">
            <el-input v-model="formData['user_id']" placeholder="请输入申请人ID"
              :disabled="hasDisabledPermission('user_id',false)"
              :readonly="!hasEditPermission('user_id',false)" clearable :style="{width: '100%'}">
            </el-input>
          </el-form-item>
        </el-col>
        <!-- 申请人名称 -->
        <el-col :span="24" v-if="hasFormPermission('user_name')">
          <el-form-item :label="$t('申请人名称')" prop="user_name">
            <el-input v-model="formData['user_name']" placeholder="请输入申请人名称"
              :disabled="hasDisabledPermission('user_name',false)"
              :readonly="true" clearable :style="{width: '100%'}">
            </el-input>
          </el-form-item>
        </el-col>
        <!-- 申请时间 -->
        <el-col :span="24" v-if="hasFormPermission('apply_time')" v-show="showFlag">
          <el-form-item :label="$t('申请时间')" prop="apply_time">
            <avue-information-body :operationVal="operationVal" infoType='date'
              :whetherToRebindSecondaryEditing='false' v-model="formData['apply_time']" placeholder="当前时间申请时间"
              :disabled="hasDisabledPermission('apply_time',true)"
              :readonly="!hasEditPermission('apply_time',true)" :style="{width: '100%'}">
            </avue-information-body>
          </el-form-item>
        </el-col>
        <!-- 部门简称 -->
        <el-col :span="24" v-if="hasFormPermission('depart_short_name')" v-show="showFlag">
          <el-form-item :label="$t('部门简称')" prop="depart_short_name">
            <el-input v-model="formData['depart_short_name']" placeholder="请输入部门简称"
              :disabled="hasDisabledPermission('depart_short_name',false)"
              :readonly="!hasEditPermission('depart_short_name',false)" clearable
              :style="{width: '100%'}"></el-input>
          </el-form-item>
        </el-col>
        <!-- 部门ID -->
        <el-col :span="24" v-if="hasFormPermission('depart_id')">
          <el-form-item :label="$t('部门')" prop="depart_id">
            <el-select v-model="formData['depart_id']" placeholder="请选择部门ID"
              :disabled="hasDisabledPermission('depart_id',false)" filterable clearable
              @change="Handleselect"
              :style="{width: '100%'}">
              <el-option v-for="(item, index) in depart_idOptions" :key="index" :label="item.F_ShortName"
                :value="item.F_DepartmentId" :disabled="item.disabled"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <!-- 是否生效 -->
        <el-col :span="24" v-if="hasFormPermission('is_effective')" v-show="showFlag">
          <el-form-item :label="$t('是否生效')" prop="is_effective">
            <el-input v-model="formData['is_effective']" placeholder="请输入是否生效"
              :disabled="hasDisabledPermission('is_effective',false)"
              :readonly="!hasEditPermission('is_effective',false)" clearable :style="{width: '100%'}">
            </el-input>
          </el-form-item>
        </el-col>
        <!-- 产品类型 -->
        <el-col :span="24" v-if="hasFormPermission('skill_type')">
          <el-form-item :label="$t('产品类型')" prop="skill_type">
            <el-select v-model="formData['skill_type']" placeholder="请选择产品类型"
              :disabled="hasDisabledPermission('skill_type',false)" filterable clearable
              @change="selectSkillType"
              :style="{width: '100%'}">
              <el-option v-for="(item, index) in skill_typeOptions" :key="index" :label="item.F_ItemName"
                :value="item.F_ItemValue" :disabled="item.disabled"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <!-- 其他说明 -->
        <el-col :span="24" v-if="hasFormPermission('other_dec')" v-show="skillFlag">
          <el-form-item :label="$t('其他说明')">
            <el-input v-model="formData['other_dec']" type="textarea" placeholder="请输入其他说明"
              :disabled="hasDisabledPermission('other_dec',false)"
              :readonly="!hasEditPermission('other_dec',false)" :autosize="{minRows: 4, maxRows: 4}"
              :style="{width: '100%'}"></el-input>
          </el-form-item>
        </el-col>
        <!-- 适用范围 -->
        <el-col :span="24" v-if="hasFormPermission('skill_scope')">
          <el-form-item :label="$t('适用范围')" prop="skill_scope">
            <el-select v-model="formData['skill_scope']" placeholder="请选择适用范围"
              :disabled="hasDisabledPermission('skill_scope',false)" filterable clearable
              :style="{width: '100%'}">
              <el-option v-for="(item, index) in skill_scopeOptions" :key="index" :label="item.F_ItemName"
                :value="item.F_ItemValue" :disabled="item.disabled"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <!-- 需求清单 -->
        <el-col :span="24" >
          <el-form-item :label="$t('需求清单')">
            <div class="border1">
              <!-- 表格头 -->
              <div class="table-header">
                <div class="table-header-items-sort">序号</div>
                <div class="table-header-items">名称</div>
                <div class="table-header-items">技术参数</div>
                <div class="table-header-items">数量</div>
                <div class="table-header-items">技术交底日期</div>
                <div class="table-header-items">工期（天）</div>
                <div class="table-header-items">供应商</div>
                <div class="table-header-items">操作</div>
              </div>
              <!-- 表格体 -->
              <div class="table-body" v-for="(item,index) in formData.details" :key="index">
                <div class="table-body-items-sort lineheight80">{{index+1}}</div>
                <div class="table-body-items lineheight80">
                  <el-input v-model="item.name" placeholder="请输入"></el-input>
                </div>
                <div class="table-body-items lineheight80">
                  <el-input v-model="item.technical_specification" placeholder="请输入"></el-input>
                </div>
                <div class="table-body-items lineheight80">
                  <el-input v-model.number="item.amount" placeholder="请输入"></el-input>
                </div>
                <div class="table-body-items lineheight80">
                  <el-date-picker
                      v-model="item.technical_disclosure_date"
                      type="date"
                      value-format="yyyy-MM-dd"
                      placeholder="选择日期">
                  </el-date-picker>
                </div>
                <div class="table-body-items lineheight80">
                  <el-input v-model="item.duration" placeholder="请输入工期时间"></el-input>
                </div>
                <!-- 供应商 -->
                <div class="table-body-items">
                  <el-input @focus="handleSelect(index)" v-model="item.supplier_form_ids" placeholder="请选择"></el-input>
                </div>
                <div class="table-body-items lineheight80">
                  <el-link :disabled="formData.details.length == 1" type="primary" @click="delDetails(index)">删除</el-link>
                </div>
              </div>
            </div>
            <div>
                <el-link type="primary" @click="addDetails">添加</el-link>
            </div>
          </el-form-item>
        </el-col>

        <!-- 技术讨论会会议纪要 -->
        <el-col :span="24" v-if="hasFormPermission('meeting_dec_url')">
          <el-form-item :label="$t('技术讨论会会议纪要')" prop="meeting_dec_url">
            <xjr-custom-upload :config="meeting_dec_urlConfig"
              :disabled="hasDisabledPermission('meeting_dec_url',false)"
              v-model="formData['meeting_dec_url']" list-type="text"></xjr-custom-upload>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label-width="0" prop="field119437c">
            <div style="border-top: 1px solid #dcdfe6;margin-top: 0px;margin-bottom: 0px;"></div>
          </el-form-item>
        </el-col>
        <el-col :span="24" v-if="hasWorkFlowFormPermission('field120dfe9')" v-show="optionsFlag">
          <el-form-item :label="$t('意见簿')" prop="field120dfe9">
            <xjr-opinion-comonent :value="formData.field120dfe9"></xjr-opinion-comonent>
          </el-form-item>
        </el-col>
        <el-col :span="24" v-if="!isWorkflowForm">
          <el-form-item size="large" v-if="isEdit">
            <el-button type="primary" @click="submitForm" :loading="submitLoading">
              {{submitLoading?$t('workFlow.WFMenu.hintSubmit'):$t('submit')}}</el-button>
            <el-button @click="cancelForm">{{$t('cancelText')}}</el-button>
          </el-form-item>
        </el-col>
      </el-form>
    </el-row>
    <!-- 供应商名称 -->
    <el-dialog
      append-to-body	
      title="供应商名称"
      :visible.sync="approvalFormVisible1"
      width="880px"
      :before-close="handleClose">
      <Approval3 ref="approvals"></Approval3>
      <span slot="footer" class="dialog-footer">
        <div class="height16"></div>
        <el-button @click="approvalFormVisible1 = false">取 消</el-button>
        <el-button type="primary" @click="sure1">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>

  import FilterableDataList from '@/components/generator/clientComponents/FilterableDataList.vue';
  import workflowFormAuthorize from "@/mixins/workflowFormAuthorize";
  import authorizeMixin from "@/mixins/authorize";
  import { baseUrl } from "@/config/env";
  import request from "@/router/axios";
  import Approval3 from '../components/approval3.vue';
  import {getUserDetailsById} from '@/api/user.js';
  export default {
    mixins: [authorizeMixin,workflowFormAuthorize],
    components: {Approval3},
    props: ['keyValue', 'isEdit', 'disabled'],
    data() {
      let _this = this
      return {
        submitLoading: false,
        showForm: true,
        showFormKey: 1,
        reRenderSubform: false,
        operationVal: 'add',
        isAdd: true,
        addressUrl:'skillprotocol',
        mainTableName: 'oa_skill_protocol',
        formConfig: {},
        approvalFormVisible1:false,
        formData: {
          'field100bb34': '',
          'current_user_id': '',
          'job': '',
          'role_id': '',
          'role_name': '',
          'area': '',
          'user_id': '',
          'user_name': '',
          'apply_time': '',
          'depart_short_name': '',
          'depart_id': '',
          'is_effective': "0",
          'skill_type': '',
          'other_dec': '',
          'skill_scope': '',
          'skill_form': '',
           details: [
            {
              name: "",//名称
              technical_specification: "",//技术参数
              amount: '',//数量
              technical_disclosure_date: "",//技术交底日期
              duration: '',//工期天
              supplier_form_ids: "",//供应商表单ids
            }
          ],
          'meeting_dec_url': null,
          'field119437c': '',
          'field120dfe9': null,
        },
        rules: {
          job: [{
            required: true,
            message: '请输入职级名称',
            trigger: 'blur'
          }],
          role_id: [{
            required: true,
            message: '请输入角色ID',
            trigger: 'blur'
          }],
          role_name: [{
            required: true,
            message: '请输入角色名称',
            trigger: 'blur'
          }],
          area: [{
            required: true,
            message: '请输入地区',
            trigger: 'blur'
          }],
          user_id: [{
            required: true,
            message: '请输入申请人ID',
            trigger: 'blur'
          }],
          user_name: [{
            required: true,
            message: '请输入申请人名称',
            trigger: 'blur'
          }],
          depart_short_name: [{
            required: true,
            message: '请输入部门简称',
            trigger: 'blur'
          }],
          depart_id: [{
            required: true,
            message: '请选择部门ID',
            trigger: 'change'
          }],
          is_effective: [{
            required: true,
            message: '请输入是否生效',
            trigger: 'blur'
          }],
          skill_type: [{
            required: true,
            message: '请选择产品类型',
            trigger: 'change'
          }],
          other_dec: [],
          skill_scope: [{
            required: true,
            message: '请选择适用范围',
            trigger: 'change'
          }],
          meeting_dec_url: [],
        },
        depart_idOptions: [],
        skill_typeOptions: [],
        skill_scopeOptions: [],
        meeting_dec_urlConfig: {
          "showTip": false,
          "fileSize": 2,
          "sizeUnit": "MB",
          "buttonText": "点击上传",
          "disabled": false
        },
        skillFlag:false,
        showFlag:false
      }
    },
    computed: {},
    watch: {},
    created() {
      this.formConfig = this.getFormConfig();
    },
    async mounted() {
      //TODO   再这里做数据回填 请求表单数据
      if(this.keyValue){
          this.isAdd = false;
      }
      if(!this.isAdd&&this.keyValue){
          this.operationVal = 'edit';
          try {
            let res = await request({
              url: baseUrl + "/"+this.addressUrl+"/" + this.keyValue,
              method: "get",
            });
              
        this.formData = res.data.data
        
              this.showFormKey++;
          } catch (error) {
          }
      }
      if (typeof this.getSkill_typeOptions == "function") {
        await this.getSkill_typeOptions();
      }
      if (typeof this.getSkill_scopeOptions == "function") {
        await this.getSkill_scopeOptions();
      }
      await this.getUserInfo()

    },
    methods: {
      sure1(){
        let self = this
        this.$refs.approvals.historyTaskData = this.$refs.approvals.historyTaskData.filter(e => e.isChecked)
        this.$refs.approvals.myTaskData = this.$refs.approvals.myTaskData.filter(e => e.isChecked)
        this.$refs.approvals.manualTaskData = this.$refs.approvals.manualTaskData.filter(e => e.isChecked)
          if(this.$refs.approvals.historyTaskData && this.$refs.approvals.historyTaskData.length > 0){
              self.formData.details[self.index].supplier_form_ids = self.$refs.approvals.historyTaskData[0].processInstanceId
          }
          if(self.$refs.approvals.myTaskData && self.$refs.approvals.myTaskData.length > 0){
              self.formData.details[self.index].supplier_form_ids = self.$refs.approvals.myTaskData[0].processInstanceId
          }
          if(this.$refs.approvals.manualTaskData && this.$refs.approvals.manualTaskData.length > 0){
            this.formData.details[this.index].supplier_form_ids = this.$refs.approvals.manualTaskData[0].processInstanceId
          }
          this.selectData1 = [...this.$refs.approvals.historyTaskData,...this.$refs.approvals.myTaskData,...this.$refs.approvals.manualTaskData]
          this.approvalFormVisible1 = false
      },
      handleSelect(index){
        this.index = index
        this.approvalFormVisible1 = true
      },
      delDetails(i){
        this.formData.details.splice(i,1)
      },
      addDetails(){
        this.formData.details.push(
          {
            name: "",//名称
            technical_specification: "",//技术参数
            amount: '',//数量
            technical_disclosure_date: "",//技术交底日期
            duration: '',//工期天
            supplier_form_ids: "",//供应商表单ids
          }
        )
      },
      selectSkillType(){
        if(this.formData['skill_type'] == 'qt'){
          this.skillFlag = true
        }else{
          this.skillFlag = false
        }
      },
      getUserInfo(){
            let params = {
              userId:this.formData['current_user_id']
            }
            getUserDetailsById(params).then(res => {
              if(res.data.success){
                this.formData['job'] = res.data.data.F_Job
                this.formData['area'] = res.data.data.F_Area
                this.formData['user_id'] = this.formData['current_user_id']
                this.formData['user_name'] = res.data.data.F_RealName
                this.depart_idOptions = res.data.data.F_Department
                this.roleData = res.data.data.F_Role
                this.initRole()
                this.initDepartmentData()
              }
            })
      },
          initDepartmentData(){
        if(this.depart_idOptions && this.depart_idOptions.length == 1){
          this.formData['depart_short_name'] = this.depart_idOptions[0].F_FullName
          this.formData['depart_id'] = this.depart_idOptions[0].F_DepartmentId
        }
      },
      Handleselect(){
        if(this.depart_idOptions && this.depart_idOptions.length > 0){
          this.depart_idOptions.forEach(e => {
            if(e.F_DepartmentId == this.formData['depart_id']){
              this.formData['depart_short_name'] = e.F_ShortName
            }
          })
        }
      },
      initRole(){
          let roleId = []
          let roleName = []
          if(this.roleData && this.roleData.length > 0){
            this.roleData.forEach(e => {
              roleId.push(e.F_RoleId)
              roleName.push(e.F_FullName)
            })
          }
          this.formData['role_id'] = roleId.join(',')
          this.formData['role_name'] = roleName.join(',')
      },
      getFormData() {
        let key = this.mainTableName + 'Entity';
        let returnParams = {};
        returnParams[key] = this.formData;
        return {
          ...returnParams,
        };
      },
      validateForm() {
        this.$refs['elForm'].validate(valid => {});
      },
      async aysncValidateForm() {
        let validataArry = []
        validataArry.push(new Promise((resolve, reject) => {
          this.$refs['elForm'].validate(valid => {
            resolve(valid)
          })
        }))
        let res = await Promise.all(validataArry)
        if (res.includes(false)) {
          return false
        }
        else {
          return true;
        }
      },
      changeTableData() {},
      async submitForm() {
        this.submitLoading = true;
        let valid = await this.aysncValidateForm();
        if (valid == false) {
          this.submitLoading = false;
          return false;
        }
        this.changeTableData();
        //格式化数据
        let newObj = this.getFormData();
        
          //如果没有传入参数就是新增
          if (!this.keyValue) {

            request({
              url: baseUrl + "/"+this.addressUrl,
              method: "post",
              data : newObj
            }).then((res) => {
              this.submitLoading = false;
              this.$notify({
                title: "成功",
                message: "新增成功",
                type: "success",
              });
              this.$emit("onChange",true)
            });

          }
          else{

          request({
              url: baseUrl + "/"+this.addressUrl+"/" + this.keyValue,
              method: "put",
              data : newObj
            }).then((res) => {
              this.submitLoading = false;
              this.$notify({
                title: "成功",
                message: "修改成功",
                type: "success",
              });
              this.$emit("onChange",true)
            });

          }
        
        
        
      },
      cancelForm() {
        this.$emit("onChange", true)
      },
      formatTree(data, valueField, lableField, childField, type) {
        let tree = [];
        data.forEach((node, index) => {
          let newNode = {
            value: node[valueField],
            label: node[lableField],
          };
          if (type) {
            newNode.disabled = node[valueField] == undefined ? true : false
          }
          tree.push(newNode);
          if (node[childField] != null && node[childField].length > 0) {
            newNode.children = (this.formatTree(node[childField], valueField, lableField, childField,
            type));
          }
        }, this);
        return tree;
      },
      //辅助工作流 审批(编辑) 预留方法
      handleEdit() {
      },
      async getSkill_typeOptions() {
        // 注意：this.$axios是通过Vue.prototype.$axios = axios挂载产生的
        try {
          let resp = await this.$axios({
            method: 'get',
            url:  baseUrl + '/data-items/0/detail',
          });
          if (resp.data.data) {
            this.skill_typeOptions = resp.data.data;
          }
        }
        catch (error) {}
      },
      async getSkill_scopeOptions() {
        // 注意：this.$axios是通过Vue.prototype.$axios = axios挂载产生的
        try {
          let resp = await this.$axios({
            method: 'get',
            url:  baseUrl + '/data-items/jsfaxy_syfw/detail',
          });
          if (resp.data.data) {
            this.skill_scopeOptions = resp.data.data;
          }
        }
        catch (error) {}
      },
      //子表单权限
      getAuthorityTableChildrenList(bindTable, children) {
        let column = [];
        if (bindTable && this.formEnCodeList && this.formEnCodeList[bindTable]) {
          let formSubEnCodeList = this.formEnCodeList[bindTable];
          if (children && children.length > 0) {
            column = children.map(ele2 => {
              if (formSubEnCodeList.includes(ele2.prop)) {
                ele2.hide = false;
              }
              else {
                ele2.hide = true;
              }
              if (ele2.hide == false) {
                //工作流中系统表单必填权限
                if (this.formSubTableNotRequiredList[bindTable] != undefined) {
                  if (this.formSubTableNotRequiredList[bindTable].includes(ele2.prop)) {
                    ele2.required = false;
                  }
                  else {
                    ele2.required = true;
                  }
                }
                ele2.rules = [];
                if (ele2.required) {
                  ele2.rules = ele2.ruleList;
                }
                // disabled 属性
                if (this.formSubTableDisabledList[bindTable] != undefined) {
                  if (this.formSubTableDisabledList[bindTable].includes(ele2.prop)) {
                    ele2.disabled = true;
                  }
                  else {
                    ele2.disabled = false;
                  }
                }
              }
              return ele2;
            });
          }
          return column;
        }
        else {
          return children;
        }
      },
      getFormConfig() {
        let config = {
          "fields": [{
            "__vModel__": "field100bb34",
            "__config__": {
              "label": "技术方案协议等文件审批单",
              "showLabel": false,
              "titleColor": null,
              "fontSize": null,
              "tag": "h2",
              "span": 24,
              "align": "top",
              "justify": "start",
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 100
            }
          }, {
            "__vModel__": "current_user_id",
            "__type__": "info",
            "infoType": "user",
            "__organize__": true,
            "__config__": {
              "label": "当前用户",
              "showLabel": true,
              "tag": "avue-information-body",
              "avueType": "information-body",
              "defaultValue": "316231f32f1f0e5a4c56bf855806b924",
              "required": false,
              "span": 24,
              "whetherToRebindSecondaryEditing": false,
              "bindTableField": "current_user_id",
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 101,
              "placeholder": "当前用户",
              "fieldLength": "50",
              "bindTable": "oa_skill_protocol",
              "bindTableFieldType": "varchar"
            }
          }, {
            "__vModel__": "job",
            "__config__": {
              "label": "职级名称",
              "showLabel": true,
              "tag": "el-input",
              "avueType": "input-tip",
              "required": true,
              "span": 24,
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 102,
              "fieldLength": "50",
              "bindTable": "oa_skill_protocol",
              "bindTableField": "job",
              "bindTableFieldType": "varchar"
            }
          }, {
            "__vModel__": "role_id",
            "__config__": {
              "label": "角色ID",
              "showLabel": true,
              "tag": "el-input",
              "avueType": "input-tip",
              "required": true,
              "span": 24,
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 103,
              "fieldLength": 500,
              "bindTable": "oa_skill_protocol",
              "bindTableField": "role_id",
              "bindTableFieldType": "varchar"
            }
          }, {
            "__vModel__": "role_name",
            "__config__": {
              "label": "角色名称",
              "showLabel": true,
              "tag": "el-input",
              "avueType": "input-tip",
              "required": true,
              "span": 24,
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 104,
              "fieldLength": 500,
              "bindTable": "oa_skill_protocol",
              "bindTableField": "role_name",
              "bindTableFieldType": "varchar"
            }
          }, {
            "__vModel__": "area",
            "__config__": {
              "label": "地区",
              "showLabel": true,
              "tag": "el-input",
              "avueType": "input-tip",
              "required": true,
              "span": 24,
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 105,
              "fieldLength": "50",
              "bindTable": "oa_skill_protocol",
              "bindTableField": "area",
              "bindTableFieldType": "varchar"
            }
          }, {
            "__vModel__": "user_id",
            "__config__": {
              "label": "申请人ID",
              "showLabel": true,
              "tag": "el-input",
              "avueType": "input-tip",
              "required": true,
              "span": 24,
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 106,
              "fieldLength": "50",
              "bindTable": "oa_skill_protocol",
              "bindTableField": "user_id",
              "bindTableFieldType": "varchar"
            }
          }, {
            "__vModel__": "user_name",
            "__config__": {
              "label": "申请人名称",
              "showLabel": true,
              "tag": "el-input",
              "avueType": "input-tip",
              "required": true,
              "span": 24,
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 107,
              "fieldLength": "50",
              "bindTable": "oa_skill_protocol",
              "bindTableField": "user_name",
              "bindTableFieldType": "varchar"
            }
          }, {
            "__vModel__": "apply_time",
            "__type__": "info",
            "infoType": "date",
            "__organize__": true,
            "__config__": {
              "label": "申请时间",
              "showLabel": true,
              "tag": "avue-information-body",
              "avueType": "information-body",
              "defaultValue": "2022-07-11 16:51:27",
              "required": false,
              "span": 24,
              "whetherToRebindSecondaryEditing": false,
              "bindTableField": "apply_time",
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 109,
              "placeholder": "当前时间",
              "fieldLength": "100",
              "bindTable": "oa_skill_protocol",
              "bindTableFieldType": "varchar"
            }
          }, {
            "__vModel__": "depart_short_name",
            "__config__": {
              "label": "部门简称",
              "showLabel": true,
              "tag": "el-input",
              "avueType": "input-tip",
              "required": true,
              "span": 24,
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 110,
              "fieldLength": "50",
              "bindTable": "oa_skill_protocol",
              "bindTableField": "depart_short_name",
              "bindTableFieldType": "varchar"
            }
          }, {
            "__vModel__": "depart_id",
            "__config__": {
              "label": "部门ID",
              "showLabel": true,
              "tag": "el-select",
              "avueType": "select",
              "span": 24,
              "required": true,
              "saveField": "",
              "showField": "",
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 111,
              "fieldLength": "50",
              "bindTable": "oa_skill_protocol",
              "bindTableField": "depart_id",
              "bindTableFieldType": "varchar"
            }
          }, {
            "__vModel__": "is_effective",
            "__config__": {
              "label": "是否生效",
              "showLabel": true,
              "tag": "el-input",
              "avueType": "input-tip",
              "defaultValue": "0",
              "required": true,
              "span": 24,
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 112,
              "fieldLength": "10",
              "bindTable": "oa_skill_protocol",
              "bindTableField": "is_effective",
              "bindTableFieldType": "int"
            }
          }, {
            "__vModel__": "skill_type",
            "__config__": {
              "label": "产品类型",
              "showLabel": true,
              "tag": "el-select",
              "avueType": "select",
              "span": 24,
              "required": true,
              "saveField": "",
              "showField": "",
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 113,
              "dataType": "dataItem",
              "dataItem": "0",
              "fieldLength": "10",
              "bindTable": "oa_skill_protocol",
              "bindTableField": "skill_type",
              "bindTableFieldType": "varchar"
            }
          }, {
            "tempType": "textarea",
            "__vModel__": "other_dec",
            "__config__": {
              "label": "其他说明",
              "showLabel": true,
              "tag": "el-input",
              "avueType": "textarea",
              "required": false,
              "span": 24,
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 115,
              "fieldLength": "500",
              "bindTable": "oa_skill_protocol",
              "bindTableField": "other_dec",
              "bindTableFieldType": "varchar"
            }
          }, {
            "__vModel__": "skill_scope",
            "__config__": {
              "label": "适用范围",
              "showLabel": true,
              "tag": "el-select",
              "avueType": "select",
              "span": 24,
              "required": true,
              "saveField": "",
              "showField": "",
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 116,
              "dataType": "dataItem",
              "dataItem": "jsfaxy_syfw",
              "fieldLength": "50",
              "bindTable": "oa_skill_protocol",
              "bindTableField": "skill_scope",
              "bindTableFieldType": "varchar"
            }
          }, {
            "__vModel__": "skill_form",
            "__config__": {
              "label": "表格",
              "showLabel": true,
              "tag": "el-input",
              "avueType": "input-tip",
              "required": true,
              "span": 24,
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 117,
              "fieldLength": 500,
              "bindTable": "oa_skill_protocol",
              "bindTableField": "skill_form",
              "bindTableFieldType": "varchar"
            }
          }, {
            "__vModel__": "meeting_dec_url",
            "__config__": {
              "label": "技术讨论会会议纪要",
              "tag": "el-upload",
              "avueType": "upload",
              "defaultValue": null,
              "showLabel": true,
              "required": false,
              "span": 24,
              "showTip": false,
              "buttonText": "点击上传",
              "fileSize": 2,
              "sizeUnit": "MB",
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 118,
              "fieldLength": "500",
              "bindTable": "oa_skill_protocol",
              "bindTableField": "meeting_dec_url",
              "bindTableFieldType": "varchar"
            }
          }, {
            "__vModel__": "field119437c",
            "__config__": {
              "label": "分割线",
              "showLabel": false,
              "direction": "horizontal",
              "contentPosition": "",
              "tag": "el-divider",
              "top": 0,
              "bottom": 0,
              "span": 24,
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 119
            }
          }, {
            "tempType": "textarea",
            "__vModel__": "field120dfe9",
            "__type__": "opinion",
            "__config__": {
              "label": "意见簿",
              "showLabel": true,
              "tag": "xjr-opinion-comonent",
              "defaultValue": null,
              "span": 24,
              "F_LgMarkCode": "",
              "prestrainField": "",
              "formId": 120
            }
          }]
        };
        return config;
      },
    }
}

</script>
<style>
.el-table__empty-block {
  width: 100% !important;
}

.avue-form__row {
  padding: 0 !important;
}

#editorphone {
  width: 375px;
  margin: 0 auto;
  border: 1px solid #E4E7ED;
  padding: 0 7.5px;
  background: #f5f6fa;
  height: 700px;
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 5px;
}

#editorphone .el-col {
  border-bottom: 1px solid #F2F2F2;
  background: #fff;
  margin-bottom: 0;
  padding: 0 15px 6px !important;
  width: 100%;
}

#editorphone .el-form-item__label {
  line-height: 20px
}

#editorphone .el-input-group .el-input__inner {
  background: #f5f6fa
}

#editorphone .el-input__inner {
  border: 0
}

#editorphone .el-input-group__append,
#editorphone .el-input-group__prepend {
  border: 0;
  background: #edeef2;
  color: #666;
}

#editorphone .el-input-group .el-input__prefix {
  left: 44px
}

#editorphone .el-input-group .el-input__suffix {
  right: 44px
}

#editorphone .el-form-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-flow: wrap;
}

#editorphone .el-form-item__label {
  float: none;
  min-width: 85px;
  width: auto !important;
  text-align: left;
  flex: auto;
}

#editorphone .tinymce .el-form-item__label {
  min-width: 100%;
}

#editorphone .el-form-item__content {
  margin-left: 0px !important;
  flex: auto;
  width: calc(100% - 95px);
}

#editorphone .avueFormNoLable .el-form-item__label,
#editorphone .avueFormNoLable .avue-crud__pagination {
  display: none;
}

#editorphone .avueFormNoLable .el-collapse-item__wrap,
#editorphone .avueFormNoLable .el-collapse {
  border-bottom: 0
}

#editorphone .avueFormNoLable .el-col {
  border-bottom: 0;
  padding-bottom: 0
}

#editorphone .el-form-item__content .el-button:first-child {
  margin-left: 90px;
}

.el-upload__tip {
  line-height: 1.2;
}

</style>
<style scoped>
.table{
  width: 100%;
}
.table-header{
  width: 100%;
  height: 40px;
  background: #f2f2f2;
  display: flex;
  flex-direction: row;
}

.table-header-items{
  width: 150px;
  height: 100%;
  border: 1px solid #999;
  text-align: center;
}
.table-header-items-sort{
  width: 100px;
  height: 100%;
  border: 1px solid #999;
  text-align: center; 
}
.table-body{
  width: 100%;
  height: 40px;
  background: #fff;
  display: flex;
  flex-direction: row;
}
.table-body-items{
  width: 150px;
  height: 40px;
  border: 1px solid #999;
  text-align: center;
}
.table-body-items-sort{
  width: 100px;
  height: 40px;
  border: 1px solid #999;
  text-align: center;
}
.lineheight80{
  line-height: 40px;
}
</style>